package entity

import (
	"manager/model/po"
)

type RouteList struct {
	Id int64 `gorm:"column:id;type:BIGINT;primary_key" json:"id"`

	UserId int64 `gorm:"column:user_id;type:BIGINT" json:"user_id"`

	EbikeId int64 `gorm:"column:ebike_id;type:BIGINT" json:"ebike_id"`

	StartName string `gorm:"column:start_name;type:VARCHAR(255)" json:"start_name"`

	StartCoordinate po.Point `gorm:"column:start_coordinate;type:POINT" json:"start_coordinate"`

	EndName string `gorm:"column:end_name;type:VARCHAR(255)" json:"end_name"`

	EndCoordinate po.Point `gorm:"column:end_coordinate;type:POINT" json:"end_coordinate"`

	List po.Array[po.GpsLocation] `gorm:"column:list;type:JSON" json:"list"`

	Mileage int `gorm:"column:mileage;type:TINYINT" json:"mileage"`

	AvgSpeed int `gorm:"column:avg_speed;type:TINYINT" json:"avg_speed"`

	MaxSpeed int `gorm:"column:max_speed;type:TINYINT" json:"max_speed"`

	StartTime int `gorm:"column:start_time;type:TINYINT" json:"start_time"`

	EndTime int `gorm:"column:end_time;type:TINYINT" json:"end_time"`

	City string `gorm:"column:city;type:VARCHAR(255)" json:"city"`

	IsFinish int `gorm:"column:is_finish;type:TINYINT" json:"is_finish"`

	CreatedAt int64 `gorm:"column:created_at;type:BIGINT" json:"created_at"`

	UpdatedAt int64 `gorm:"column:updated_at;type:BIGINT" json:"updated_at"`
}

func (a *RouteList) TableName() string {
	return "route_lists"
}
